<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/displaytag-11.tld" prefix="display"%>
<script language="JavaScript" src="<%= request.getContextPath() + "/js/calendar6.js" %>"></script>
<script language="JavaScript" src="<%= request.getContextPath() + "/js/popUP.js" %>"></script>
<link href="<%= request.getContextPath() + "/css/bloques.css" %>" rel="stylesheet" type="text/css">


<script language="javascript">
  function buscarSubprogramas(accion){
    document.frmRenovarMasiva.action = '<%=request.getContextPath()+"/beneficios/RenovarMasiva.do"%>'
    document.frmRenovarMasiva.accion.value = accion;
    document.frmRenovarMasiva.submit();
  }
  
  function activar()
  {
    document.frmRenovarMasiva.continuar.disabled=false;
  }
  
</script>
<script src="<%=request.getContextPath()%>/js/displaytag.js" type="text/javascript"></script>
<table cellspacing="3" cellpadding="2" border="0" width="70%" align="center">
  <form name="frmRenovarMasiva" action="<%=request.getContextPath()+"/beneficios/ValidarRenovarMasiva.do"%>" method="get">
  <tr>
    <td class="titulosenblanco" colspan="3">
      <DIV align="center">
        Renovacion&nbsp;Masiva&nbsp;de&nbsp;Beneficios      </DIV>
    </td>
  </tr>
  <tr>
    <td class="titulosenblanco" colspan="3">&nbsp;</td>
  </tr>
  <tr>
    <td align="center" class="celdatabla" colspan="3">Seleccione una opcion</td>
  </tr>
  <tr>
    <td class="titulosenblanco" colspan="3">&nbsp;</td>
  </tr>
    
  <tr>
    <td class="celdatabla" width="31%">Programa:</td>
    <td width="44%">
      <logic:notPresent name="programas">
        <DIV align="center">
          <%= session.getAttribute("msg")%>
        </DIV>
      </logic:notPresent>
        <%   Object codePrograma = request.getParameter("codePrograma"); %>
        <div align="left">
          <logic:present name="programas">
            <logic:iterate id="programa" name="programas" length="1" type="com.cs.beneficios.business.model.ProgramaVO">
              <html:select name="programa" property="codePrograma" onchange="buscarSubprogramas('1');" title="Programa" styleClass="form" value="<%=(String)codePrograma%>">
                <option value="nulo">Seleccione un programa</option>
                <html:options name="programas" labelName="codigo" labelProperty="nombre" property="code" collection="programas"/>
              </html:select>
            </logic:iterate>
          </logic:present>
        </div>
      
    </td>
    <td class="celdatabla" width="25%">&nbsp;</td>
  </tr>
  <% 
     if(codePrograma != null){
  %>
  <tr>
    <td class="celdatabla" width="31%">Beneficio:</td>
    <td width="44%">
      <div align="left">
        <logic:notPresent name="subprogramas">
          <DIV align="center">
            <%= session.getAttribute("msg")%>
          </DIV>
        </logic:notPresent>
        <%   Object codeSubPrograma = request.getParameter("codeSubPrograma"); 
             if(codeSubPrograma==null) codeSubPrograma = "nulo";
       %>
        <logic:present name="subprogramas">
          <logic:iterate id="subprograma" name="subprogramas" length="1" type="com.cs.beneficios.business.model.SubProgramaVO">
            <html:select name="subprograma" property="codeSubPrograma" title="Programa" styleClass="form" value="<%=(String)codeSubPrograma%>" onchange="buscarSubprogramas('1');">
              <option value="nulo">Seleccione un subprograma</option>
              <html:options name="subprogramas" labelName="codigo" labelProperty="nombre" property="code" collection="subprogramas"/>
            </html:select>
          </logic:iterate>
        </logic:present>
      </div>
    </td>
    <td class="celdatabla" width="25%">&nbsp;</td>
  </tr>
  <% 
     }
     Object codeSubprog = request.getParameter("codeSubPrograma");
     if(codeSubprog != null)
     {
  %>
  <tr>
    <td class="celdatabla" width="31%">Sedes:</td>
    <td width="44%">
      <div align="left">
        <logic:notPresent name="sedes">
            <DIV align="center">
              <% if(session.getAttribute("msg") != null){%>
              <%= session.getAttribute("msg")%>
              <%}%>
            </DIV>
            <%session.removeAttribute("msg");%>
        </logic:notPresent>
  <%    Object codeSede = request.getParameter("codeSede"); 
        if(codeSede==null) codeSede = "nulo";
  %>
    
          <logic:present name="sedes">
            <logic:iterate id="sede" name="sedes" length="1" type="com.cs.beneficios.business.model.SedeVO">
              <html:select onclick="activar()" name="sede" property="code" title="Sede" styleClass="form" value="<%=(String)codeSede%>">
                <html:options name="sede" labelName="codeSede" labelProperty="nombre" property="code" collection="sedes"/>
              </html:select>
            </logic:iterate>
          </logic:present>
        </div>
      </td>
    </tr>
  <%}%>
  <tr>
    <td class="celdatabla" width="31%">&nbsp;</td>
    <td width="44%">
      <div align="center">
           <input type="HIDDEN" name="accion"/>
          <input type="SUBMIT" disabled="disabled" value="Continuar" name="continuar"/>
        <P></P>
      </div>
    </td>
    <td class="celdatabla" width="25%">&nbsp;</td>
  </tr>
  
  </form>
</table>



